package com.hfzy.ihk.facade.calldata.enums;

import com.hfzy.ihk.common.facade.CustomEnumType;

import java.util.HashMap;
import java.util.Map;

/**
 * 呼叫来源应用
 * @author wws
 */
public enum WhereFrom implements CustomEnumType {

    APP("0", "app"),
    ZY("1", "置业"),
    FILTER_PHONE_NO("2", "洗号"),
    FILTER_TEL_NO("3", "洗主显"),
    JOB("99999", "job"),
    NEW_CUSTOMER("5", "新版电子客"),
    BAO_LI("11", "保利云呼测试"),
    AI_LINK_CALL("10", "智能外呼系统");

    private WhereFrom(String value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    private String value;

    private String desc;
    @Override
    public String getValue() {
        return value;
    }
    @Override
    public String getDesc() {
        return desc;
    }

    private static Map<String, WhereFrom> map = new HashMap<>();
    static {
        for (WhereFrom value : WhereFrom.values()) {
            map.put(value.getValue(), value);
        }
    }

    public static WhereFrom fromValue(String value) {
        WhereFrom ret = map.get(value);
        if (ret != null) {
            return ret;
        } else {
            throw new IllegalArgumentException("No enum const " + WhereFrom.class + "." + value);
        }
    }

}
